package com.kkm.pojo;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Consumer {

  private long id;
  private String username;
  private String password;
  private int  sex;
  private String phone_num;
  private String email;
  private String birth;
  private String introduction;
  private String location;
  private String avator;
  private Date createTime;
  private Timestamp updateTime;
  private String problem;
  private String answer;
  private String sexStr;
  private String birthTime;

  public String getBirthTime() {
    SimpleDateFormat sdf=new SimpleDateFormat("yyyy年MM月dd日");
    return sdf.format(birth);
  }

  public void setBirthTime(String birthTime) {
    this.birthTime = birthTime;
  }

  public String getSexStr() {
    if(sex==0){
      return "男";
    }
    return "女";
  }

  public void setSexStr(String sexStr) {
    this.sexStr = sexStr;
  }

  public Consumer() {
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  public int getSex() {
    return sex;
  }

  public void setSex(int sex) {
    this.sex = sex;
  }

  public void setGender(String gender) {
    this.sex = sex;
  }

  public String getPhone_num() {
    return phone_num;
  }

  public void setPhone_num(String phone_num) {
    this.phone_num = phone_num;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

//  public Date getBirth() {
//    return birth;
//  }
//
//  public void setBirth(Timestamp birth) {
//    this.birth = birth;
//  }

  public String getBirth() {
    return birth;
  }

  public void setBirth(String birth) {
    this.birth = birth;
  }

  public String getIntroduction() {
    return introduction;
  }

  public void setIntroduction(String introduction) {
    this.introduction = introduction;
  }

  public String getLocation() {
    return location;
  }

  public void setLocation(String location) {
    this.location = location;
  }

  public String getAvator() {
    return avator;
  }

  public void setAvator(String avator) {
    this.avator = avator;
  }

  public Date getCreateTime() {
   return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public Timestamp getUpdateTime() {
    return updateTime;
  }

  public void setUpdateTime(Timestamp updateTime) {
    this.updateTime = updateTime;
  }

  public String getProblem() {
    return problem;
  }

  public void setProblem(String problem) {
    this.problem = problem;
  }

  public String getAnswer() {
    return answer;
  }

  public void setAnswer(String answer) {
    this.answer = answer;
  }

  @Override
  public String toString() {
    return "Consumer{" +
            "id=" + id +
            ", username='" + username + '\'' +
            ", password='" + password + '\'' +
            ", sex='" + sex + '\'' +
            ", phone_num='" + phone_num + '\'' +
            ", email='" + email + '\'' +
            ", birth=" + birth +
            ", introduction='" + introduction + '\'' +
            ", location='" + location + '\'' +
            ", avator='" + avator + '\'' +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
            '}';
  }
}
